﻿using System.IO;

namespace EasyComm.Utilities
{
    public static class FileUtils
    {
        public static void SaveFile(byte[] fileBuffer, string filePath)
        {
            if (!Directory.Exists(Path.GetDirectoryName(filePath)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(filePath));
            }
            using (FileStream fs = new FileStream(filePath, FileMode.Create))
            {
                fs.Write(fileBuffer, 0, fileBuffer.Length);
            }
        }
    }
}
